perm filename A27.TEX[106,RWF]1 blob sn#807812 filedate 1985-11-01 generic text, type C, neo UTF8
COMMENT āŠ—   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	\magnification\magstephalf
C00004 ENDMK
CāŠ—;
\magnification\magstephalf
\input macro.tex
\def\today{\ifcase\month\or
  January\or February\or March\or April\or May\or June\or
  July\or August\or September\or October\or November\or December\fi
  \space\number\day, \number\year}
\baselineskip 14pt
\rm
\line{\sevenrm a27.tex[106,phy] \today\hfill}

\font\rmn=amr9

\bigskip
{\rmn
{\narrower\smallskip\noindent
{\bf Exercise:} [Indefinite iteration, reading, programming logic.] 
An input file contains a sequence of positive integer data in groups
separated by the sentinel~{\tt -1}, and terminated by the sentinel~{\tt -2}.
Your program should read the data, printing each on a separate line.
At each sentinel, print the subtotal for the group it follows. At the
terminating~{\tt -2}, also print the total of all the data. Naturally,
you don't print the sentinels or add them in.

Allow for the possibility that the number of data in a group may be zero,
and that the number of groups may be zero.
\smallskip}
}


\bigskip
\line{\copyright 1984 Robert W. Floyd; 
First draft (not published) March 15, 1984\hfil}
%revised: Date; subsequently revised.\hfill}

\bye